using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class UI_CraftCategoryButton : MonoBehaviour
{
    [SerializeField] private ItemListDataSO craftList;
    private UI_CraftItemListSlot[] slots;

    public void SetCraftItemListSlots(UI_CraftItemListSlot[] slots) => this.slots = slots;
    public void UpdateItemList()
    {
        if (craftList == null)
            return;

        foreach (var slot in slots)
            slot.gameObject.SetActive(false);

        for (int i = 0; i < craftList.itemListData.Length; i++)
        {
            slots[i].gameObject.SetActive(true);

            slots[i].UpdateSlot(craftList.itemListData[i]);
        }
    }
}
